Access = "3290265c-208217e4-9f4199c1-mk0lklo0de"
Secret = "ba86200b-b67235d4-df030850-92734"
s = f"""
GET\n

api.huobi.pro\n

/v1/order/orders\n

AccessKeyId={Access}&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2017-05-11T15%3A19%3A30&order-id=1234567890
"""
import hmac
import base64
from hashlib import sha256
import requests
appsecret = f"{Secret}".encode('utf-8')  # 秘钥
data = f"{s}".encode('utf-8')  # 加密数据
signatures = base64.b64encode(hmac.new(appsecret, data, digestmod=sha256).digest())
print(signatures)
signature = signatures.decode()
print(signature)
# 获取十六进制加密数据
# signature = base64.b64decode(hmac.new(appsecret, data, digestmod=sha256).hexdigest())
# signatures = base64.b64encode(signature)
# print(signatures)

key = f'https://' \
      f'api.huobi.pro' \
      f'/v1/order/orders?&' \
      f'AccessKeyId={Access}&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2017-05-11T15%3A19%3A30&order-id=1234567890'

url = key+"&Signature="+f'{signature}'
print(url)